#ifndef _TASK_TCP_H_
#define _TASK_TCP_H_

#include "../define/define.h"
#include "../trans_server/server.h"
#include "../tcp_server/tcp_server.h"
#include "../tcp_client/tc_man.h"

class task_tcp : public tcp_sink
{
public:
    
	task_tcp(uint32 port)
	{
		m_server = new tcp_server(this,port);
		//m_trans  = new server(1,NULL);
	}

    ~task_tcp()
	{
		delete m_server;
		delete m_trans;
	}
	
protected:

	bool OnSend()
	{
         //m_clent->get_buf();
         //m_server->sendbuf();
	}

	bool OnError()
	{
		return false;
	}

	bool OnRead(uint32 socket, char* buf, uint32 buf_size)
	{
		m_trans->Put_data(socket,buf,buf_size);
	}

	bool OnAccpet(uint32 socket, sockaddr sock_addr)
	{
		return false;
	}

private:

   tcp_server*  m_server;

   server*      m_trans;
   tc_man*      m_clent;
};
#endif
